<template>
    <div class="user-page">
        <div class="header-bar">
            <span class="icon icon-set"></span>
            <h2>个人中心</h2>
            <div class="icon icon-msg">
                <span class="tips"  v-show="isLogin">9+</span>
            </div>
        </div>
        <div class="user-bar">
            <div class="head is-login">
                <img  v-show="isLogin" src="../img/user-head.jpg" alt="head">
            </div>
            <div class="btn login username">{{loginUser}}</div>
            <div class="store">
                <i class="icon icon-star"></i>
                <span>我的收藏（5）</span>
            </div>
        </div>

        <div class="order-bar">
            <div class="order">
                <span>我的订单</span>
                <a href="javascript:;">查看全部订单</a>
            </div>

            <div class="order-type">
                <a class="type" href="javascript:;">
                    <span class="icon-groups">
                        <i class="tips"  v-show="isLogin">0</i>
                    </span>
                    <h5>待付款</h5>
                </a>
                <a class="type" href="javascript:;">
                    <span class="icon-groups">
                        <i class="tips"  v-show="isLogin">2</i>
                    </span>
                    <h5>待发货</h5>
                </a>
                <a class="type" href="javascript:;">
                    <span class="icon-groups">
                        <i class="tips"  v-show="isLogin">1</i>
                    </span>
                    <h5>待收货</h5>
                </a>
                <a class="type" href="javascript:;">
                    <span class="icon-groups">
                        <i class="tips" v-show="isLogin">3</i>
                    </span>
                    <h5>待评价</h5>
                </a>
                <a class="type" href="javascript:;">
                    <span class="icon-groups">
                        <i class="tips"  v-show="isLogin">5</i>
                    </span>
                    <h5>退款/售后</h5>
                </a>
            </div>
        </div>

        <a href="javascript:;" class="addr">收货地址管理</a>

        <MenuBar></MenuBar>
    </div>
</template>

<script>
// import MenuBar from "../components/menuBar";
export default {
  name: "UserPage",
  components: {
    // MenuBar
  },
  data() {
    return {
      msg: "",
      loginUser: "",
      toLogin: "点击登录",
      isLogin : false,
    };
  },
  methods: {
    checkLogin() {
      let user = this.$LsyCookie.getItem("currentLoginUser");
      if(user){
          this.isLogin = true;
      }
      this.loginUser = user ? user : this.toLogin;
    }
  },
  created() {
    this.checkLogin();
  }
};
</script>

<style scoped lang="less">
@import "../style/user.less";
</style>